package leetcode;

/**
 * Created with IntelliJ IDEA.
 * User: Ghost
 * Date: 14-5-31
 * Time: 下午7:00
 * To change this template use File | Settings | File Templates.
 */
public class SingleNumber {
    public int singleNumber(int[] A){
        if(A==null || A.length==0)
            return 0;
        int rst = A[0];
        for(int i=1;i<A.length;i++){
            rst = rst ^ A[i];
        }
        return rst;
    }
    public static void main(String[] args){
        SingleNumber s = new SingleNumber();
        int[] A = {1,2,3,3,2};
        System.out.println(s.singleNumber(A));
    }
}
